package com.yiyang.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yiyang.domain.po.NurseContent;
import com.yiyang.domain.po.NurseLevel;
import com.yiyang.domain.po.NurseLevelItem;
import com.yiyang.mapper.NurseContentMapper;
import com.yiyang.mapper.NurseLevelItemMapper;
import com.yiyang.service.NurseLevelService;
import com.yiyang.mapper.NurseLevelMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author 31044
* @description 针对表【nurse_level】的数据库操作Service实现
* @createDate 2024-10-08 11:41:22
*/
@Service
public class NurseLevelServiceImpl extends ServiceImpl<NurseLevelMapper, NurseLevel>
    implements NurseLevelService{

    @Autowired
    private NurseLevelItemMapper nurseLevelItemMapper;

    @Autowired
    private NurseContentMapper nurseContentMapper;


    @Override
    public List<NurseContent> listNurseItemByLevel(Integer levelId) {
        //根据levelId查询出所有的itemId
        List<Integer> itemByLevelId = nurseLevelItemMapper.getItemByLevelId(levelId);
        // 根据多个itemId查询出所有的护理项目
        List<NurseContent> nurseContentList = nurseContentMapper.selectBatchIds(itemByLevelId);

        return nurseContentList;
    }
}






















